Skip to contentSkip to conversation

can't start Kernel Logging Service when enable SELinux on sytemd

selinux [email protected] 2 participants 2 messages Apr 23, 2025 – Apr 28, 2025

lore
Share & tools
lore
#0 lore raw

Hi
I build an image with SELinux enabled and use systemd as an init manager. On kernel boot stage,  I receive the following errors:
[FAILED] Failed to start Kernel Logging Service.
[FAILED] Failed to start System Logging Service.

I search the audit log and find that it was denied by SELinux:
type=AVC msg=audit(1651167746.923:54): avc:  denied  { map } for  pid=234 comm="klogd" path="/bin/busybox.nosuid" dev="mmcblk0p7" ino=19 scontext=system_u:system_r:klogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=0 type=AVC msg=audit(1651167746.936:57): avc:  denied  { map } for  pid=235 comm="syslogd" path="/bin/busybox.nosuid" dev="mmcblk0p7" ino=19 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:bin_t:s0 tclass=file permissive=0

I know that busybox use sh wrappers instead of links to get the correct security labels when SELinux enabled, but this seems not work.

Do you have any adivce?

#1 lore raw

Use a permissive policy for debugging.

--

Having more context (e.g. PATH, SYSCALL, CWD) would help (ausearch).

You may need to disable service auto-startup to gather these details (and that may or may not work). Remove properties like "WantedBy" and "Before" and then manually start them.

--

I've generally found Fedora's policy to be an excellent reference, as SELinux (fork) is enabled by default: https://github.com/fedora-selinux/selinux-policy

Clayton Casciato